import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

import '../../../widget/price_Widget/index.dart';

class PaymentsFooterWidget extends ConsumerStatefulWidget {
  final int totalPayPrice;

  const PaymentsFooterWidget({super.key, required this.totalPayPrice});

  @override
  _PaymentsFooterWidgetState createState() => _PaymentsFooterWidgetState();
}

class _PaymentsFooterWidgetState extends ConsumerState<PaymentsFooterWidget> {
  @override
  Widget build(BuildContext context) {
    return Positioned(
      left: 0,
      right: 0,
      bottom: 0,
      child: Container(
        padding: const EdgeInsets.symmetric(horizontal: 10),
        height: 60,
        decoration: const BoxDecoration(color: Colors.white),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Row(
              children: [
                const Text("合計: "),
                PriceWidget(price: "${widget.totalPayPrice}"),
              ],
            ),
            TextButton(
              onPressed: () {},
              child: Container(
                width: 90,
                height: 40,
                alignment: Alignment.center,
                decoration: const BoxDecoration(color: Colors.teal),
                child: const Text(
                  "去支付",
                  style: TextStyle(color: Colors.white, fontSize: 14),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
